package com.dareway.thread;

public class Thread_resume_suspend {
    public static void main(String[] args) {
        Thread t = new Thread(()->{
            System.out.println("线程开始运行！");
            Thread.currentThread().suspend();   //暂停此线程
            System.out.println("线程继续运行！");
        });
        t.start();
        try {
            Thread.sleep(5000);
            t.resume();
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }
}
